package com.letian.im.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.im.mapper.ImGroupUserMapper;
import com.letian.im.domain.ImGroupUser;
import com.letian.im.service.IImGroupUserService;

/**
 * 群组用户Service业务层处理
 * 
 * @author bmz
 * @date 2024-01-28
 */
@Service
public class ImGroupUserServiceImpl implements IImGroupUserService 
{
    @Autowired
    private ImGroupUserMapper imGroupUserMapper;

    /**
     * 查询群组用户
     * 
     * @param id 群组用户主键
     * @return 群组用户
     */
    @Override
    public ImGroupUser selectImGroupUserById(Long id)
    {
        return imGroupUserMapper.selectImGroupUserById(id);
    }

    /**
     * 查询群组用户列表
     * 
     * @param imGroupUser 群组用户
     * @return 群组用户
     */
    @Override
    public List<ImGroupUser> selectImGroupUserList(ImGroupUser imGroupUser)
    {
        return imGroupUserMapper.selectImGroupUserList(imGroupUser);
    }

    /**
     * 新增群组用户
     * 
     * @param imGroupUser 群组用户
     * @return 结果
     */
    @Override
    public int insertImGroupUser(ImGroupUser imGroupUser)
    {
        imGroupUser.setCreateTime(DateUtils.getNowDate());
        return imGroupUserMapper.insertImGroupUser(imGroupUser);
    }

    /**
     * 修改群组用户
     * 
     * @param imGroupUser 群组用户
     * @return 结果
     */
    @Override
    public int updateImGroupUser(ImGroupUser imGroupUser)
    {
        imGroupUser.setUpdateTime(DateUtils.getNowDate());
        return imGroupUserMapper.updateImGroupUser(imGroupUser);
    }

    /**
     * 批量删除群组用户
     * 
     * @param ids 需要删除的群组用户主键
     * @return 结果
     */
    @Override
    public int deleteImGroupUserByIds(Long[] ids)
    {
        return imGroupUserMapper.deleteImGroupUserByIds(ids);
    }

    /**
     * 删除群组用户信息
     * 
     * @param id 群组用户主键
     * @return 结果
     */
    @Override
    public int deleteImGroupUserById(Long id)
    {
        return imGroupUserMapper.deleteImGroupUserById(id);
    }
}
